﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Net.NetworkInformation;
using System.Net;

public enum Protocol
{
    Tcp,
    Udp
}

/// <summary>
/// Summary description for NetworkStats
/// </summary>
public class NetworkStats
{
	public NetworkStats()
	{		
	}    

    public IPEndPoint[] GetListners(Protocol protocol)
    {
        switch (protocol)
        {
            case Protocol.Tcp:
                return IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpListeners();
            case Protocol.Udp:
                return IPGlobalProperties.GetIPGlobalProperties().GetActiveUdpListeners();
        }
        throw new ArgumentException("Invalid protocol");
    }
}
